<template>
  <div>
    <!-- 标签页 -->
    <el-tabs v-model="activeName" @tab-click="handleClick">
      <el-tab-pane label="销售投诉" name="first"></el-tab-pane>
      <el-tab-pane label="维修投诉" name="second"></el-tab-pane>
      <el-tab-pane label="金融投诉" name="third"></el-tab-pane>
      <el-tab-pane label="下发投诉" name="four"></el-tab-pane>
      <el-tab-pane label="任务单" name="five"></el-tab-pane>
      <el-tab-pane label="其他单据" name="six"></el-tab-pane>
    </el-tabs>
    <!-- 搜索框 -->
    <TopFilter :list="topFilterList" :cols="3" :rows="2" :labelWidth="'150'" @filterChange="changeHandle" @onCollapse="collapseHandle"></TopFilter>
    <!-- 客户投诉处理及分析列表 -->
    <FilterTable
      ref="table"
      :columns="columns"
      :fetchapi="fetchApi"
      :params="fetchParams"
      :datakey="'rows'"
      :onColumnsChange="columns => (this.columns = columns)"
      :onRowSelectChange="onRowSelectChange"
      :isExportExcel="true"
      exportFileName="客诉单管理.xlsx"
      selectionType="single"
      columnsRef="CustomerComplaintManagementNemo"
      :isServerColumnsRef="true"
    >
      <template slot="controls">
        <el-button v-show="isact" size="small" type="primary" icon="el-icon-plus" @click="addComplaint()">新&nbsp;&nbsp;增</el-button>

        <el-button size="small" type="primary" @click="openComplaintHistory()">投诉历史</el-button>

        <el-button size="small" type="primary" @click="openRepairHistory()">维修历史</el-button>

        <el-button size="small" type="primary" @click="openReturnVisitHistory()">回访历史</el-button>

        <!-- <el-button size="small" type="primary" icon="el-icon-download" :loading="exportLoading" @click="exportFile()" >导&nbsp;&nbsp;出</el-button> -->
      </template>
    </FilterTable>
    <!-- 处理 -->
    <Drawer :visible.sync="showDetail" title="客诉单维护" :width="1200" destroyOnClose :containerStyle="{ height: 'calc(100% - 60px)', overflow: 'auto', paddingBottom: '60px' }">
      <Detail :editComplaintId="editComplaintId" :type="type" @close="cancle" />
    </Drawer>
    <!-- 投诉历史 -->
    <Drawer :visible.sync="showComplaintHistory" title="投诉历史" destroyOnClose :containerStyle="{ height: 'calc(100% - 60px)', overflow: 'auto', paddingBottom: '60px' }">
      <ComplaintHistory :vin="chooseVin" @close="closeDia" />
    </Drawer>
    <!-- 维修历史 -->
    <Drawer :visible.sync="showRepairHistory" title="维修历史" destroyOnClose :containerStyle="{ height: 'calc(100% - 60px)', overflow: 'auto', paddingBottom: '60px' }">
      <RepairHistory :getdata="repairHistoryData" @close="closeDia" />
    </Drawer>

    <!-- 回访历史 -->
    <Drawer :visible.sync="showReturnVisitHistory" title="回访历史" destroyOnClose :containerStyle="{ height: 'calc(100% - 60px)', overflow: 'auto', paddingBottom: '60px' }">
      <ReturnVisisHisitory :resData="visitHistoryData" @close="closeDia" />
    </Drawer>
  </div>
</template>
<script>
import { mapState } from 'vuex';
import { dictionary } from '@/utils/dictMixin';
import { exportExcelFile } from '@/utils';
import dictCode from '@/utils/dictCode';
import { getUser } from '@/assets/js/auth';

import { searchRoleByCode, searchRoleByCodes } from '@/api/common/empSelect/index';
import { searchDealerOrg, getDealerUser } from '@/api/customerRepair/customerComplaint/customerComplaintReception';
import { queryComplaint, delComplaintById, acceptComplaintById } from '@/api/customerRepair/customerComplaint/customerComplaintQuery';
import { exportComplaint } from '@/api/customerRepair/customerComplaint/customerComplaintAnalysis';

import Detail from '@/pages/customerRepair/customerComplaint/customerComplaintMng/complaintEdit.vue';
import ComplaintHistory from '@/pages/repair/business/customer/combination/complaint';
import RepairHistory from '@/pages/repair/business/customer/Repairhistory/historypop.vue';
import ReturnVisisHisitory from '@/pages/customerRepair/customerComplaint/customerComplaintMng/complaintReturnVisitHistory.vue';

export default {
  name: 'CustomerComplaintManagementNemo',
  components: {
    Detail,
    RepairHistory,
    ReturnVisisHisitory,
    ComplaintHistory
  },
  mixins: [dictionary],
  data() {
    this.BaseTable = null;
    this.selectData = {};
    return {
      topFilterList: this.createTopFilterList(),
      fetchApi: queryComplaint, // 获取客户投诉处理及分析列表表格接口
      fetchParams: { xhrAbort: true }, // 获取客户投诉处理及分析列表表格参数
      columns: this.createTableColumns(), // 客户投诉处理及分析列表表格列
      showDetail: false, // 显示客户投诉处理及分析
      showComplaintHistory: false, // 显示投诉历史dialog
      showRepairHistory: false, // 显示维修历史dialog
      showReturnVisitHistory: false, // 显示回访历史dialog
      exportLoading: false, // 导出加载中
      editComplaintId: '', // 选中的客户投诉Id
      visitHistoryData: {}, // 回访历史传入数据
      repairHistoryData: {}, // 维修历史传入数据
      chooseVin: '', // 选中的vin
      dataList: {},
      type: '',
      selectFlag: false,
      activeName: 'first',
      par: {
        complaintType: '82151003',
        isOem: '10041002',
        complaintKind: '82131001'
      },
      isact: true
    };
  },
  created() {},
  mounted() {
    this.BaseTable = this.$refs.table.$refs.pageTable;
    this.getEmp();
    this.getOrg();
  },
  methods: {
    // handleClick(tab, event) {
    //     if(this.activeName == 'first'){
    //       // 销售投诉
    //       // 2020.7.17修改
    //       // 修改查询条件isOem在选择对应页签时的值以及默认值
    //       this.par.complaintType = '82151003'
    //       this.par.isOem = '10041002'
    //       this.par.complaintKind = '82131001'
    //       this.isact = true
    //     }else if(this.activeName == 'second'){
    //       // 维修投诉
    //       this.par.complaintType = '111'
    //       this.par.isOem = '10041002'
    //       this.par.complaintKind = '82131001'
    //       this.isact = true
    //     }else if(this.activeName == 'third'){
    //       // 其他投诉
    //       this.par.complaintType = '82151004'
    //       this.par.isOem = '10041002'
    //       this.par.complaintKind = '82131001'
    //       this.isact = true
    //     }else if(this.activeName == 'four'){
    //       // 下发投诉
    //       this.par.complaintType = '222'
    //       this.par.isOem = '10041001'
    //       this.par.complaintKind = '82131001'
    //       this.isact = false
    //     }else{
    //       // 任务单
    //       this.par.complaintType = '222'
    //       this.par.isOem = '10041001'
    //       this.par.complaintKind = '82131002'
    //       this.isact = false
    //     }
    //   },
    handleClick(tab, event) {
      if (this.activeName == 'first') {
        // 销售投诉
        // 2020.7.17修改
        // 修改查询条件isOem在选择对应页签时的值以及默认值
        this.par.complaintType = '82151003';
        this.par.isOem = '10041002';
        this.par.complaintKind = '82131001';
        this.isact = true;
      } else if (this.activeName == 'second') {
        // 维修投诉
        this.par.complaintType = '111';
        this.par.isOem = '10041002';
        this.par.complaintKind = '82131001';
        this.isact = true;
      } else if (this.activeName == 'third') {
        // 其他投诉
        // 20207.28 其他投诉修改为金融投诉
        this.par.complaintType = '82151004';
        this.par.isOem = '10041002';
        this.par.complaintKind = '82131001';
        this.isact = true;
      } else if (this.activeName == 'four') {
        // 下发投诉
        this.par.complaintType = '222';
        this.par.isOem = '10041001';
        this.par.complaintKind = '82131001';
        this.isact = false;
      } else if (this.activeName == 'five') {
        // 任务单
        this.par.complaintType = '222';
        this.par.isOem = '10041001';
        this.par.complaintKind = '82131002';
        this.isact = false;
      } else {
        // 其他单据
        this.par.complaintType = '222';
        this.par.isOem = '10041002';
        this.par.complaintKind = '333';
        this.isact = true;
      }
    },
    createTopFilterList() {
      return [
        {
          type: 'RANGE_DATE',
          label: '',
          fieldName: 'beginDate|endDate',
          placeholder: '选择日期',
          labelOptions: {
            fieldName: 'dateType',
            initialValue: 1001,
            itemList: [
              { text: '投诉日期', value: 1001 },
              { text: '受理日期', value: 1002 },
              { text: '关单日期', value: 1003 }
            ]
          },
          rules: [{ required: false, message: '请选择日期', trigger: 'change' }]
        },
        {
          type: 'SELECT',
          label: '处理人',
          filterable: true,
          fieldName: 'principal',
          // initialValue: getUser(),
          itemList: []
        },
        {
          type: 'SELECT',
          label: '投诉接待员',
          filterable: true,
          fieldName: 'receptionst',
          // initialValue: getUser(),
          itemList: []
        },
        {
          type: 'INPUT',
          label: '投诉编号',
          fieldName: 'complaintNo',
          placeholder: '请输入...'
        },
        // {
        //   type: 'SELECT',
        //   label: '单据类型',
        //   fieldName: 'complaintKind',
        //   itemList: this.createDictList('8213')
        // },
        // {
        //   type: 'SELECT',
        //   label: '是否厂家下发',
        //   fieldName: 'isOem',
        //   itemList: this.createDictList('1004')
        // },
        {
          type: 'SELECT',
          label: '处理状态',
          fieldName: 'handleStatus',
          itemList: this.createDictList('8048')
        },
        {
          type: 'SELECT',
          label: '结案状态',
          fieldName: 'closeStatus',
          initialValue: 80421001,
          itemList: this.createDictList('8042')
        },
        // {
        //   type: 'SELECT',
        //   label: '投诉类型',
        //   fieldName: 'complaintType',
        //   itemList: this.createDictList('8215')
        // },
        {
          type: 'SELECT',
          label: '投诉来源',
          fieldName: 'complaintOrigin',
          itemList: this.createDictList('8009')
        },
        {
          type: 'SELECT',
          label: '优先级',
          fieldName: 'priority',
          itemList: this.createDictList('8032')
        },
        {
          type: 'INPUT',
          label: '车牌号',
          fieldName: 'license',
          placeholder: '请输入...'
        },
        {
          type: 'INPUT',
          label: '车主姓名',
          fieldName: 'ownerName',
          placeholder: '请输入...'
        }
      ];
    },
    createTableColumns() {
      return [
        {
          title: '序号',
          dataIndex: 'index',
          width: 70,
          fixed: 'left',
          sorter: true,
          render: props => {
            return <span>{props.row.index + 1}</span>;
          }
        },
        {
          title: '操作',
          dataIndex: 'column-action',
          fixed: 'left',
          width: 180,
          render: props => {
            return (
              <div>
                <el-button size="mini" type="text" onClick={() => this.openEditDetail(props.row)} disabled={props.row.HANDLE_STATUS == 80481012 || props.row.HANDLE_STATUS == 80481011}>
                  处理
                </el-button>

                <el-divider direction="vertical" />

                <el-button size="mini" type="text" onClick={() => this.openDetail(props.row)}>
                  查看
                </el-button>

                <el-divider direction="vertical" />

                <el-button size="mini" type="text" onClick={() => this.del(props.row)} disabled={props.row.HANDLE_STATUS !== 80481001 || props.row.IS_OEM === 10041001}>
                  删除
                </el-button>
              </div>
            );
          }
        },
        {
          title: '投诉编号',
          dataIndex: 'COMPLAINT_NO',
          filter: true,
          filterType: 'input',
          showOverflowTooltip: true
        },
        {
          title: '是否厂端下发',
          dataIndex: 'IS_OEM',
          sorter: true,
          filter: true,
          showOverflowTooltip: true,
          filterType: 'radio',
          filterItems: this.createDictList(1004),
          dictItems: this.createDictList('1004')
          // render: props => {
          //   return <span>{this.createDictText(props.row.IS_OEM, 1004)}</span>;
          // }
        },
        {
          title: '投诉类别',
          dataIndex: 'COMPLAINT_KIND',
          sorter: true,
          filter: true,
          showOverflowTooltip: true,
          filterType: 'radio',
          filterItems: this.createDictList(8213),
          dictItems: this.createDictList('8213')
          // render: props => {
          //   return <span>{this.createDictText(props.row.COMPLAINT_KIND, 8213)}</span>;
          // }
        },
        {
          title: '投诉类型',
          dataIndex: 'COMPLAINT_TYPE',
          sorter: true,
          filter: true,
          showOverflowTooltip: true,
          filterType: 'radio',
          filterItems: this.createDictList(8215),
          dictItems: this.createDictList('8215')
          // render: props => {
          //   return <span>{this.createDictText(props.row.COMPLAINT_TYPE, 8007)}</span>;
          // }
        },
        {
          title: '投诉来源',
          dataIndex: 'COMPLAINT_ORIGIN',
          sorter: true,
          filter: true,
          filterType: 'radio',
          showOverflowTooltip: true,
          filterItems: this.createDictList(8009),
          dictItems: this.createDictList('8009')
          // render: props => {
          //   return <div>{this.createDictText(props.row.COMPLAINT_ORIGIN, '8009')}</div>;
          // }
        },
        {
          title: '投诉时间',
          dataIndex: 'COMPLAINT_DATE',
          sorter: true,
          filter: true,
          filterType: 'date-range',
          showOverflowTooltip: true
        },
        {
          title: '投诉接待人',
          dataIndex: 'RECEPTIONIST',
          editType: 'select',
          editable: false,
          sorter: true,
          filter: true,
          filterType: 'radio',
          showOverflowTooltip: true,
          editItems: [],
          filterItems: []
        },
        {
          title: '处理人',
          dataIndex: 'PRINCIPAL',
          editType: 'select',
          editable: false,
          sorter: true,
          filter: true,
          filterType: 'radio',
          showOverflowTooltip: true,
          editItems: [],
          filterItems: []
        },
        {
          title: '处理状态',
          dataIndex: 'HANDLE_STATUS',
          sorter: true,
          filter: true,
          filterType: 'radio',
          showOverflowTooltip: true,
          filterItems: this.createDictList(8048),
          dictItems: this.createDictList('8048')
          // render: props => {
          //   return <div>{this.createDictText(props.row.HANDLE_STATUS, '8048')}</div>;
          // }
        },
        {
          title: '客户要求',
          dataIndex: 'COMPLAINT_SUMMARY',
          sorter: true,
          filter: true,
          filterType: 'input',
          showOverflowTooltip: true
        },
        {
          title: '反映问题',
          dataIndex: 'COMPLAINT_REASON',
          sorter: true,
          filter: true,
          filterType: 'input',
          showOverflowTooltip: true
        },
        {
          title: '解决方案',
          dataIndex: 'RESOLVENT',
          sorter: true,
          filter: true,
          filterType: 'input',
          showOverflowTooltip: true
        },
        {
          title: '客户反馈',
          dataIndex: 'RECALL_CONTENT',
          sorter: true,
          filter: true,
          filterType: 'input',
          showOverflowTooltip: true
        },
        {
          title: '处理完成时间',
          dataIndex: 'COMPLAINT_END_DATE',
          sorter: true,
          filter: true,
          filterType: 'date-range',
          showOverflowTooltip: true
        },
        {
          title: '结案状态',
          dataIndex: 'CLOSE_STATUS',
          sorter: true,
          filter: true,
          filterType: 'radio',
          showOverflowTooltip: true,
          filterItems: this.createDictList(8042),
          dictItems: this.createDictList('8042')
          // render: props => {
          //   return <div>{this.createDictText(props.row.CLOSE_STATUS, '8042')}</div>;
          // }
        },
        {
          title: '结案时间',
          dataIndex: 'CLOSE_DATE',
          sorter: true,
          filter: true,
          filterType: 'date-range',
          showOverflowTooltip: true
        },
        {
          title: '被投诉部门',
          dataIndex: 'DEPARTMENT',
          editType: 'select',
          editable: false,
          sorter: true,
          filter: true,
          filterType: 'radio',
          showOverflowTooltip: true,
          editItems: []
        },
        {
          title: '被投诉员工',
          dataIndex: 'BE_COMPLAINT_EMP',
          editType: 'select',
          editable: false,
          sorter: true,
          filter: true,
          filterType: 'radio',
          showOverflowTooltip: true,
          editItems: []
        },
        {
          title: '底盘号',
          dataIndex: 'VIN',
          filter: true,
          filterType: 'input',
          showOverflowTooltip: true
        },
        {
          title: '车牌号',
          dataIndex: 'LICENSE',
          sorter: true,
          filter: true,
          filterType: 'input',
          showOverflowTooltip: true
        },
        {
          title: 'JD',
          dataIndex: 'JD',
          sorter: true,
          filter: true,
          filterType: 'input',
          dictItems: this.createDictList(1004),
          render: props => {
            return <span>{this.createDictText(props.row.JD, 1004)}</span>;
          }
        },
        {
          title: '车主姓名',
          dataIndex: 'OWNER_NAME',
          sorter: true,
          filter: true,
          filterType: 'input',
          showOverflowTooltip: true
        },
        {
          title: '投诉人姓名',
          dataIndex: 'COMPLAINT_NAME',
          sorter: true,
          filter: true,
          filterType: 'input',
          showOverflowTooltip: true
        },
        {
          title: '投诉人电话',
          dataIndex: 'COMPLAINT_MOBILE',
          sorter: true,
          filter: true,
          filterType: 'input',
          showOverflowTooltip: true
        },
        {
          title: '服务顾问',
          dataIndex: 'SERVICE_ADVISOR',
          sorter: true,
          filter: true,
          filterType: 'input',
          showOverflowTooltip: true,
          editType: 'select',
          editable: false,
          editItems: []
        },
        {
          title: '责任技师',
          dataIndex: 'TECHNICIAN',
          sorter: true,
          filter: true,
          filterType: 'input',
          showOverflowTooltip: true,
          editType: 'select',
          editable: false,
          editItems: []
        }
      ];
    },
    // 搜索
    changeHandle(val) {
      this.dataList = val;
      this.dataList.complaintKind = this.par.complaintKind;
      this.dataList.isOem = this.par.isOem;
      this.dataList.complaintType = this.par.complaintType;
      this.fetchParams = Object.assign({}, this.dataList, { xhrAbort: false });
    },
    canCalList() {
      this.dataList.complaintKind = this.par.complaintKind;
      this.dataList.isOem = this.par.isOem;
      this.dataList.complaintType = this.par.complaintType;
      this.fetchParams = Object.assign({}, this.dataList, { xhrAbort: false });
    },
    collapseHandle() {
      this.$nextTick(() => {
        this.BaseTable.EXECUTE_RESET_HEIGHT();
      });
    },
    addComplaint() {
      this.editComplaintId = null;
      this.type = 'create';
      this.showDetail = true;
    },
    // 明细
    openEditDetail(row) {
      this.editComplaintId = row.COMPLAINT_ID;
      this.type = 'edit';
      this.showDetail = true;
    },
    openDetail(row) {
      this.editComplaintId = row.COMPLAINT_ID;
      this.type = 'detail';
      this.showDetail = true;
    },
    onRowSelectChange(val) {
      if (val.length == 0) {
        this.selectFlag = false;
        this.selectData = {};
      } else {
        this.selectFlag = true;
        this.selectData = val[0];
      }
    },
    // 投诉历史
    openComplaintHistory() {
      if (!this.selectFlag) {
        this.$message({
          type: 'warning',
          message: '请选择表单数据!'
        });
      } else {
        if (this.selectData.VIN) {
          this.chooseVin = this.selectData.VIN;
          this.showComplaintHistory = true;
        } else {
          this.$notify.warning({ title: '提示信息', message: '该单据无底盘号，无法查看历史投诉信息!' });
        }
      }
    },
    // 维修历史
    openRepairHistory() {
      if (!this.selectFlag) {
        this.$message({
          type: 'warning',
          message: '请选择表单数据!'
        });
      } else {
        if (this.selectData.VIN) {
          this.title_history = '维修历史';
          this.repairHistoryData = {
            LICENSE: this.selectData.LICENSE,
            VIN: this.selectData.VIN,
            ENGINE_NO: null,
            OWNER_NAME: this.selectData.COMPLAINT_NAME
          };
          this.showRepairHistory = true;
        } else {
          this.$notify.warning({ title: '提示信息', message: '该单据无底盘号，无法查看历史维修信息!' });
        }
      }
    },
    // 回访历史
    openReturnVisitHistory() {
      if (this.selectData.COMPLAINT_NAME) {
        const khmc = this.selectData.COMPLAINT_NAME;
        const pzh = this.selectData.LICENSE;
        this.visitHistoryData = {
          ownerNo: '',
          pzh: pzh,
          khmc: khmc
        };
        this.showReturnVisitHistory = true;
      } else {
        this.$notify.warning({ title: '提示信息', message: '投诉人姓名为空，无法查看历史回访信息!' });
      }
    },
    acceptOrder(val) {
      this.$confirm('是否确认受理?', '提示', {
        confirmButtonText: '确定',
        cancelButtonText: '取消',
        type: 'warning'
      })
        .then(() => {
          acceptComplaintById(val.COMPLAINT_ID).then(res => {
            if (res.resultCode == 200) {
              this.$message.success('受理成功');
              this.canCalList();
            } else {
              this.$message.error('受理失败');
            }
          });
        })
        .catch(() => {});
    },
    // 删除
    del(val) {
      this.$confirm('是否确认删除?', '提示', {
        confirmButtonText: '确定',
        cancelButtonText: '取消',
        type: 'warning'
      })
        .then(() => {
          delComplaintById(val.COMPLAINT_ID).then(res => {
            if (res.resultCode == 200) {
              this.$message.success('删除成功');
              this.canCalList();
            } else {
              this.$message.error('删除失败');
            }
          });
        })
        .catch(() => {});
    },
    closeDia() {
      this.showComplaintHistory = false; // 显示投诉历史dialog
      this.showReturnVisitHistory = false; // 显示回访历史dialog
      this.showRepairHistory = false; // 显示维修历史dialog
    },
    // 取消弹框
    cancle() {
      this.showDetail = false;
      this.showComplaintHistory = false;
      this.showRepairHistory = false;
      this.showReturnVisitHistory = false;
      this.canCalList();
    },
    // 获取全部员工
    async getEmp() {
      const res = await getDealerUser(this.editComplaintId);
      let empList = res.data.map(x => ({ text: x.employeeName, value: x.userId + '' }));
      this.columns.find(item => item.dataIndex === 'PRINCIPAL').editItems = empList; // 处理人表格
      this.columns.find(item => item.dataIndex === 'PRINCIPAL').filterItems = empList; // 处理人表格
      this.columns.find(item => item.dataIndex === 'RECEPTIONIST').editItems = empList; // 处理人表格
      this.columns.find(item => item.dataIndex === 'RECEPTIONIST').filterItems = empList; // 处理人表格

      this.columns.find(item => item.dataIndex === 'BE_COMPLAINT_EMP').editItems = empList; // 被投诉员工表格
      let testDrive = { role: dictCode.SERVICE_CONSULTANT };
      let res5 = (await searchRoleByCode(testDrive)).data.map(x => ({ value: x.userId + '', text: x.employeeName }));
      this.columns.find(item => item.dataIndex === 'SERVICE_ADVISOR').editItems = res5; // 服务顾问表格
      let tPersonType = { role: dictCode.TECHNICIAN };
      let res6 = (await searchRoleByCodes(tPersonType)).data.map(x => ({ value: x.userId + '', text: x.employeeName }));
      this.columns.find(item => item.dataIndex === 'TECHNICIAN').editItems = res6; // 责任技师表格

      this.topFilterList.find(item => item.fieldName === 'principal').itemList = empList; // 处理人
      this.topFilterList.find(item => item.fieldName === 'receptionst').itemList = empList; // 投诉接待员
    },
    // 获取全部部门
    async getOrg() {
      const res = await searchDealerOrg(this.editComplaintId);
      let empList = res.data.map(x => ({ text: x.orgName, value: x.orgId }));
      this.columns.find(item => item.dataIndex === 'DEPARTMENT').editItems = empList; // 被投诉部门表格
      this.columns.find(x => x.dataIndex === 'DEPARTMENT').filterItems = empList; // 被投诉部门表头筛选
    },
    // 导出
    exportFile() {
      this.exportLoading = true;
      this.fetchParams.complaintKind = this.par.complaintKind;
      this.fetchParams.isOem = this.par.isOem;
      this.fetchParams.complaintType = this.par.complaintType;
      exportComplaint(this.fetchParams).then(res => {
        exportExcelFile(res, '客户投诉处理情况');
        this.exportLoading = false;
      });
    }
  }
};
</script>
